home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / JAVA Utilities / JProxy 1.1.0 / SAMPLES.JAR / com / jproxy / samples / ejb / test / Base.java < prev    next >
Encoding:
Java Source  |  2003-04-29  |  1.3 KB  |  73 lines

  1. package com.jproxy.samples.ejb.test;
  2.  
  3. import java.util.*;
  4. import javax.ejb.*;
  5.  
  6. import javax.naming.Context;
  7. import javax.naming.InitialContext;
  8. import javax.naming.NamingException;
  9.  
  10. import java.rmi.RemoteException;
  11.  
  12. /**
  13.  * The most base class in Session implementation
  14.  */
  15. public class Base
  16.     implements SessionBean
  17. {
  18.     /**
  19.      * The properties of the session
  20.      */
  21.     protected  Properties properties = null;
  22.  
  23.     /**
  24.      * SessionContext of the instance
  25.      */
  26.     protected SessionContext context = null;
  27.  
  28.     /**
  29.      * The bean create method.
  30.      */
  31.     public void ejbCreate()
  32.         throws CreateException
  33.     {
  34.         try{
  35. //            Context context = new InitialContext();
  36. //            String s = (String) context.lookup("java:comp/env/TestParameter");
  37. //            if(s!=null)
  38. //                properties.setProperty("TestParameter", s);
  39. //          do something. If do not like - throw CreateException
  40.         }
  41.         catch(Exception ne)
  42.         {
  43.             throw new CreateException(ne.getMessage());
  44.         }
  45.     }
  46.  
  47.     /**
  48.      * remove() implementation
  49.      */
  50.     public void ejbRemove(){}
  51.  
  52.     /**
  53.      * activate() implementation
  54.      */
  55.     public void ejbActivate(){}
  56.  
  57.     /**
  58.      * passivate() implementation
  59.      */
  60.     public void ejbPassivate(){}
  61.  
  62.     /**
  63.      * setSessionContext() implementation
  64.      *
  65.      * @param
  66.      */
  67.     public void setSessionContext(SessionContext sc)
  68.     {
  69.         context = sc;
  70.     }
  71.  
  72. }
  73.